
<?php
echo 'This is truth:"php is the best language!"'.'<br>'."<br>"; //我知道还可以用\".......\"这样也ok



echo "\$a是变量"."<br>"."<br>"; //”$”.”a是变量”也行啊233



$本金 = 1000;
$一年本息和 = $本金*(1+0.0225);
echo "第一年的本息和是：$一年本息和"."<br>";
$两年本息和 = $一年本息和*(1+0.0279);
echo "第二年的本息和是：$两年本息和"."<br>"."<br>";

define("pi", "3.14");
echo pi."<br>";
define("root", "user");
echo root."<br>";


$a = $_POST["a"];
$b = $_POST["b"];
$c = $_POST["c"];
if($a == 0)
	echo "兄弟是一元二次方程"."<br>";
else{
if(($b*$b - 4*$a*$c)< 0)
	echo "没有实数解呀！"."<br>";
else{
	$x1 = ((-$b+($b*$b - 4*$a*$c))/(2*$a));
	$x2 = ((-$b-($b*$b - 4*$a*$c))/(2*$a));
	echo "x1的值是$x1"."<br>"."x2的值是$x2"."<br>"."<br>";}
	}


$stu = array("no"=>"23333333","name"=>"ruby","sex"=>"女","tele"=>"888888888");
foreach ($stu as $key => $value) {
	echo "$key".":"."$value"."<br>";
}
echo "<br>";

$woods=array(array("id"=>"001","name"=>"book","cost"=>"50"),array("id"=>"002","name"=>"bread","cost"=>"5"),array("id"=>"003","name"=>"bow1","cost"=>"10"));
for($i = 0;$i < 3;$i++) {
		foreach ($woods[$i] as $key => $value) {
			echo "$key".":"."$value"."<br>";
		}
}
echo "<br>";

$汉字 = array("十","一","二","三","四","五","六","七","八","九");
for ($j=1; $j <10 ; $j++) { 
	for ($x=1; $x <=$j ; $x++) { 
		if($j*$x < 10)
		echo $汉字[$j].$汉字[$x]."得".$汉字[(int)($j*$x)]."<br>";
		else{
			echo $汉字[$j].$汉字[$x]."得".$汉字[(int)(($j*$x)/10)].$汉字[(($j*$x)%10)]."<br>";
		}
	}
}
echo "<br>";

$应收金额 = $_POST["应收金额"];
$实收金额 = $_POST["实收金额"];
if($应收金额 < $实收金额)
echo "掏错了吧兄弟";
else{
	$_100 = (int)($实收金额/100);
	$_50  =(int)(($实收金额-100*$_100)/50);
	$_20  = (int)(($实收金额-100*$_100-50*$_50)/20);
	$_10  = (int)(($实收金额-100*$_100-50*$_50-20*$_20)/10);
	$_5   = (int)(($实收金额-100*$_100-50*$_50-20*$_20-10*$_10)/5);
	$_1   = (int)(($实收金额-100*$_100-50*$_50-20*$_20-10*$_10-5*$_5)/1);
	echo "100要$_100"."张"."<br>","50要$_50"."张"."<br>","20要$_20"."张"."<br>","10要$_10"."张"."<br>","5要$_5"."张"."<br>","1要$_1"."张"."<br>";
}
echo "<br>";
 $stud =array(0=>88,1=>60,3=>99,5=>66);
 $元素 =array(0,1,3,5);
 for($w = 0;$w <6;$w++) {
 	if (in_array($w,$元素)) {
 		echo "$w"."号的成绩是".$stud[$w]."分"."<br>";
 	}
 	else{
 		continue;
 	}
 }

echo "<br>";
 $stud =array(0=>88,1=>60,3=>99,5=>66);
 $元素 =array(0,1,3,5);
 for($w = 0;$w <6;$w++) {
 	if (in_array($w,$元素)) {
 		echo "$w"."号的成绩是".$stud[$w]."分"."<br>";
 	}
 	else{
 		echo "错了兄弟没有$w"."号啊"."<br>";
 	}
 }

?>